﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Elegant2.Persistence
{
    class FacadeDAO
    {
        private static FacadeDAO singleton;
        private ITicketDAO ticketDAO;
        private IPaymentDAO paymentDAO;

        private FacadeDAO()
        {
            ITransferObject transferObject = TransferObject.Instance;
            SQLServerDAOFactory factory = new SQLServerDAOFactory(transferObject);
            ticketDAO = factory.createTicketDAO();
            paymentDAO = factory.createPaymentDAO();
        }

        public static FacadeDAO getInstance() {
		if (singleton == null) {
			singleton = new FacadeDAO();
		}
		return singleton;
	}

        public void updateTicket()
        {
            ticketDAO.updateTicket();
        }

    }
}
